﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Logica;
using Entidades1;

namespace WebSisVet1
{
    public partial class GestionAdmin : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            AdministradorBLL a = new AdministradorBLL();
            grdAdmin.DataSource = a.GetAdministrador();
            grdAdmin.DataBind();
        }

        protected void adminGriv_SelectedIndexChanged(object sender, EventArgs e)
        {
            LbMsg.Text = grdAdmin.SelectedValue.ToString();
            //1.
            //Response.Redirect("~/RegPropietario.aspx?cedula="+LbMsg.Text);
            //2.
            Session["cedula"] = LbMsg.Text;
            Session["nombre"] = grdAdmin.SelectedRow.Cells[2].Text;
            Session["apellido"] = grdAdmin.SelectedRow.Cells[3].Text;
            Session["telefono"] = grdAdmin.SelectedRow.Cells[5].Text;
            Session["direccion"] = grdAdmin.SelectedRow.Cells[4].Text;
            Session["email"] = grdAdmin.SelectedRow.Cells[6].Text;
            Session["bd"] = "mysql";
            Response.Redirect("~/RegAdmin.aspx");
        }
    }
}